import request from '@/utils/request';

export async function query(): Promise<any> {
  return request('/api/users');
}

export const queryCurrent = () => {
  return new Promise((resolve, reject) => {
    fetch('http://localhost:3006/api/currentUser')
      .then((res) => res.json())
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

export async function queryNotices(): Promise<any> {
  return request('/api/notices');
}
